var HuiZong = new Vue({

    el : '#Huizonglist',
    data :{

        editFlag : 0,					// 0:新增，1：修改
        show : false,					// 显示列表是否有数据

        danweiid:'',                    // 单位Id
        danweiList :[],                     // 单位集合
        JishuList:[],                   // 家属集合
        pageIndex : 1,
        pageSize :6,
        pageCount : 0,
        recordCount : 0,
        inputPageIndexValue : "",
        
        jingshangqingkuanglist:[],

    },
    created : function() {
        this.findDeptAll();
    },
    methods : {

        findDeptAll: function(){
            var _this = this;
            layer.open({type:3});
            $.post("../dept/findcengji_by_deptid",{
                deptid:"0",
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;

                        _this.danweiList = data;

                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },
        
        findJiashuByDanweiId: function(){
            var _this = this;
            if(!_this.danweiid){
                layer.alert("请选择单位！");
                return false;
            }
            layer.open({type:3});
            $.post("../jiashu/find_by_deptid",{
                deptid :_this.danweiid,
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        _this.JishuList = data;
                        if(data.length>0){
                            _this.show = true;
                        }
                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },

        toDaochu:function (){
            var _this = this;
            if(!_this.danweiid){
                layer.alert("请选择单位！");
                return false;
            }

            layer.confirm("确定导出当前所选单位的委托查核经商办企业信息汇总表吗？",{
                btn : ['是','否']
            },function(){
                layer.open({type:3});
                location.href = "../daochu/qiyexinxihuizong?deptid="+_this.danweiid;
                layer.closeAll("loading");
                layer.closeAll("dialog");
            })
        },


    },
    watch :{

    }

});
